home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / sgml-base.postinst < prev    next >
Text File  |  2004-10-26  |  3KB  |  113 lines

  1. #!/bin/sh
  2. ## ----------------------------------------------------------------------
  3. ## debian/postinst : postinstallation script for sgml-base
  4. ## ----------------------------------------------------------------------
  5.  
  6. ## ----------------------------------------------------------------------
  7. set -e
  8.  
  9. ## ----------------------------------------------------------------------
  10. if [ "$1" = "configure" ]
  11. then
  12.  
  13.     ## ------------------------------------------------------------------
  14.     ## create SGML root catalog
  15.     [ ! -f /etc/sgml/catalog ] \
  16.     && cp -a /usr/share/sgml-base/catalog.super /etc/sgml/catalog
  17.  
  18.     ## ------------------------------------------------------------------
  19.     ## clean up /usr/lib/sgml
  20.     if [ -d /usr/lib/sgml ]
  21.     then
  22.  
  23.     ## --------------------------------------------------------------
  24.         ## remove nasty old circular catalog
  25.     update-catalog --remove --super /usr/lib/sgml/catalog || true
  26.  
  27.     ## --------------------------------------------------------------
  28.     ## remove symlink to /etc/sgml/catalog
  29.     rm -f /usr/lib/sgml/catalog
  30.  
  31.         ## --------------------------------------------------------------
  32.     ## move transitional SGML catalog to /etc/sgml
  33.     TRANSCAT=transitional.cat
  34.     if [ -f /usr/lib/sgml/${TRANSCAT} ]
  35.     then
  36.         update-catalog --remove --super /usr/lib/sgml/${TRANSCAT} || true
  37.         mv -f /usr/lib/sgml/${TRANSCAT} /etc/sgml/${TRANSCAT}
  38.         if [ -f /usr/lib/sgml/${TRANSCAT}.old ]
  39.         then
  40.         mv -f /usr/lib/sgml/${TRANSCAT}.old /etc/sgml/${TRANSCAT}.old
  41.         fi
  42.     fi
  43.  
  44.         ## --------------------------------------------------------------
  45.         ## remove /usr/lib/sgml
  46.     cd /usr/lib
  47.     rmdir --ignore-fail-on-non-empty sgml
  48.     cd - >/dev/null
  49.  
  50.     fi
  51.  
  52.     ## ------------------------------------------------------------------
  53.     ## evolve legacy /etc/sgml.catalog
  54.     OCATALOG=/etc/sgml.catalog
  55.     if [ -f ${OCATALOG} ]
  56.     then
  57.     TRANSCAT=/etc/sgml/transitional.cat
  58.     if [ -f ${TRANSCAT} ]
  59.     then
  60.         cp ${TRANSCAT} ${TRANSCAT}.old
  61.     else
  62.         cp /usr/share/sgml-base/transitional.cat ${TRANSCAT}
  63.     fi
  64.     sed -e '1,10d' <${OCATALOG} >>${TRANSCAT}
  65.     rm -f ${OCATALOG}
  66.     if [ -f ${OCATALOG}.old ]
  67.     then
  68.         sed -e '1,10d' <${OCATALOG}.old >>${TRANSCAT}.old
  69.         rm -f ${OCATALOG}.old
  70.     fi
  71.     fi
  72.  
  73.     ## ------------------------------------------------------------------
  74.     TRANSCAT=/etc/sgml/transitional.cat
  75.     if [ -f ${TRANSCAT} ]
  76.     then
  77.     update-catalog --add --super ${TRANSCAT}
  78.     fi
  79.  
  80. fi
  81.  
  82. ## ---------------------------------------------------------------------- 
  83. ## automatically generated debhelper commands
  84. # Automatically added by dh_usrlocal
  85. if [ "$1" = configure ]; then
  86. (
  87.     while read line; do
  88.         set -- $line
  89.         dir="$1"; mode="$2"; user="$3"; group="$4"
  90.         if [ ! -e "$dir" ]; then
  91.             if mkdir "$dir" 2>/dev/null; then
  92.                 chown "$user":"$group" "$dir"
  93.                 chmod "$mode" "$dir"
  94.             fi
  95.         fi
  96.     done
  97. ) << DATA
  98. /usr/local/share 2775 root staff
  99. /usr/local/share/sgml 2775 root staff
  100. /usr/local/share/sgml/stylesheet 2775 root staff
  101. /usr/local/share/sgml/misc 2775 root staff
  102. /usr/local/share/sgml/entities 2775 root staff
  103. /usr/local/share/sgml/dtd 2775 root staff
  104. /usr/local/share/sgml/declaration 2775 root staff
  105. DATA
  106. fi
  107. # End automatically added section
  108.  
  109.  
  110. exit 0
  111.  
  112. ## ----------------------------------------------------------------------
  113.